home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 25 / CU Amiga Magazine's Super CD-ROM 25 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-08].iso / CUCD / Programming / ixemul / sdk / man / cat2 / shmat.0 < prev    next >
Encoding:
Text File  |  1998-06-15  |  2.8 KB  |  67 lines

  1.  
  2. SHMAT(2)                   UNIX Programmer's Manual                   SHMAT(2)
  3.  
  4. NNAAMMEE
  5.      sshhmmaatt, sshhmmddtt - map/unmap shared memory
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ##iinncclluuddee <<ssyyss//ttyyppeess..hh>>
  9.      ##iinncclluuddee <<ssyyss//iippcc..hh>>
  10.      ##iinncclluuddee <<ssyyss//sshhmm..hh>>
  11.  
  12.      _v_o_i_d _*
  13.      sshhmmaatt(_i_n_t _s_h_m_i_d, _v_o_i_d _*_s_h_m_a_d_d_r, _i_n_t _s_h_m_f_l_g)
  14.  
  15.      _i_n_t
  16.      sshhmmddtt(_v_o_i_d _*_s_h_m_a_d_d_r)
  17.  
  18. DDEESSCCRRIIPPTTIIOONN
  19.      sshhmmaatt() maps the shared memory segment associated with the shared memory
  20.      identifier _s_h_m_i_d into the address space of the calling process. The ad-
  21.      dress at which the segment is mapped is determined by the _s_h_m_a_d_d_r parame-
  22.      ter. If it is equal to 0, the system will pick an address itself.  Other-
  23.      wise, an attempt is made to map the shared memory segment at the address
  24.      _s_h_m_a_d_d_r specifies. If SHM_RND is set in _s_h_m_f_l_g, the system will round the
  25.      address down to a multiple of SHMLBA bytes (SHMLBA is defined in
  26.      <_s_y_s_/_s_h_m_._h> ).
  27.  
  28.      A shared memory segment can be mapped read-only by specifying the
  29.      SHM_RDONLY flag in _s_h_m_f_l_g.
  30.  
  31.      sshhmmddtt() unmaps the shared memory segment that is currently mapped at
  32.      _s_h_m_a_d_d_r from the calling process' address space.  _s_h_m_a_d_d_r must be a value
  33.      returned by a prior sshhmmaatt() call. A shared memory segment will remain ex-
  34.      istant until it is removed by a call to shmctl(2) with the IPC_RMID com-
  35.      mand.
  36.  
  37. RREETTUURRNN VVAALLUUEESS
  38.      sshhmmaatt() returns the address at which the shared memory segment has been
  39.      mapped into the calling process' address space when successful, sshhmmddtt()
  40.      returns 0 on successful completion. Otherwise, a value of -1 is returned,
  41.      and the global variable _e_r_r_n_o is set to indicate the error.
  42.  
  43. EERRRROORRSS
  44.      sshhmmaatt() will fail if:
  45.  
  46.      [EACCESS]     The calling process has no permission to access this shared
  47.                    memory segment.
  48.  
  49.      [ENOMEM]      There is not enough available data space for the calling
  50.                    process to map the shared memory segment.
  51.  
  52.      [EINVAL]      _s_h_m_i_d is not a valid shared memory identifier.
  53.  
  54.                    _s_h_m_a_d_d_r specifies an illegal address.
  55.  
  56.      [EMFILE]      The number of shared memory segments has reached the sys-
  57.                    tem-wide limit.
  58.  
  59.      sshhmmddtt() will fail if:
  60.  
  61.      [EINVAL]      _s_h_m_a_d_d_r is not the start address of a mapped shared memory
  62.                    segment.
  63.  
  64. SSEEEE AALLSSOO
  65.      shmctl(2),  shmget(2),  mmap(2)
  66.  
  67.